home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / games_d / oasys.zip / ESCAPE.S next >
Text File  |  1991-02-04  |  68KB  |  2,659 lines

  1. /*    OASYS source code for Escape from Planet Delta
  2.     by Russell Wallace 31 Jan 1991
  3.     See game introduction for details
  4. */
  5.  
  6. // Classes for abnormal objects
  7.  
  8. class room {}
  9. class player {}
  10. class button {{button}}
  11. class door {{door} {lock} {padlock}}
  12. class box {{box} {large box}}
  13.  
  14. // Classes for normal objects
  15.  
  16. class lamp {{lamp} {atomic lamp}}
  17. class card {{card} {credit card} {american express card}
  18.     {american express credit card}}
  19. class torch {{torch}}
  20. class herring {{herring} {red herring} {fish}}
  21. class safe {{safe} {large safe}}
  22. class detonator {{detonator}}
  23. class plastic_key {{plastic key}}
  24. class metal_key {{metal key}}
  25. class ceramic_key {{ceramic key}}
  26. class suit {{suit} {space suit}}
  27. class explosive {{explosive} {plastic explosive}}
  28. class mask {{mask} {gas mask}}
  29. class whisky {{whiskey} {whisky}}
  30. class disk {{disk} {floppy disk}}
  31. class drive {{drive} {disk drive}}
  32. class book {{book}}
  33. class computer {{computer}}
  34. class socket {{socket}}
  35. class ladder {{ladder}}
  36. class scrap {{scrap} {scrap metal}}
  37. class paper {{paper} {sheet}}
  38. class pan {{pan} {saucepan}}
  39. class shovel {{shovel} {spade}}
  40. class bottle {{bottle}}
  41. class rubble {{rubble}}
  42. class desk {{desk}}
  43. class tiger {{tiger}}
  44.  
  45. // Miscellaneous global variables
  46.  
  47. int drunk                // State of drunkenness of player
  48. int desk_moved
  49. int pan_moved
  50. int describe_mode        // When to give full location descriptions
  51. string null_string        // Always left equal to *NULL STRING*
  52. int drive_connected        // Is disk drive connected to computer
  53. int computer_connected    // Is computer connected to comms socket
  54. int hangar_vacuum        // Is hangar in vacuum
  55. int tiger_moved
  56.  
  57. // Global variables for objects
  58.  
  59. object lamp
  60. object card
  61. object torch
  62. object herring
  63. object safe
  64. object detonator
  65. object plastic_key
  66. object metal_key
  67. object ceramic_key
  68. object suit
  69. object explosive
  70. object mask
  71. object whisky
  72. object disk
  73. object drive
  74. object book
  75. object computer
  76. object socket
  77. object ladder
  78. object scrap
  79. object paper
  80. object pan
  81. object shovel
  82. object bottle
  83. object rubble
  84. object desk
  85. object tiger
  86.  
  87. // Global variables for locations -- all will be of class room
  88.  
  89. object control_room
  90. object corridor1
  91. object corridor2
  92. object corridor3
  93. object office1
  94. object office2
  95. object lift_top
  96. object corridor4
  97. object bar
  98. object kitchen
  99. object cargo_hold
  100. object lift_centre
  101. object explosive_store
  102. object corridor5
  103. object corridor6
  104. object chemical_store
  105. object corridor7
  106. object corridor8
  107. object storage_compartment
  108. object corridor9
  109. object locker
  110. object corridor10
  111. object corridor11
  112. object corridor12
  113. object fridge
  114. object equipment_store
  115. object lift_bottom
  116. object airlock
  117. object crater
  118. object cave_entrance
  119. object cave1
  120. object maze1
  121. object maze2
  122. object maze3
  123. object maze4
  124. object maze5
  125. object maze6
  126. object tunnel1
  127. object tunnel2
  128. object canyon_centre
  129. object canyon_south
  130. object cave2
  131. object canyon_north
  132. object canyon_teleport
  133. object hangar_teleport
  134. object hangar
  135. object corridor19
  136. object computer_room
  137. object airlock2
  138. object corridor13
  139. object corridor14
  140. object corridor15
  141. object corridor16
  142. object corridor17
  143. object corridor18
  144. object control_room2
  145.  
  146. // Object properties
  147.  
  148. property object in                // where is the object
  149. property int is_open
  150. property int is_worn
  151. property object n                // what locations are reached by going in the 8
  152. property object s                // directions of the compass + up and down
  153. property object e
  154. property object w
  155. property object ne
  156. property object nw
  157. property object se
  158. property object sw
  159. property object up
  160. property object down
  161. property int moved                // has the object been moved yet
  162. property string short_desc
  163. property string word_desc        // one-word name for the object
  164. property string long_desc
  165. property string examine_desc    // text you get when you EXAMINE the object
  166. property object door            // for locations -- the door if any
  167. property int direction            // for doors -- which direction are they in
  168. property int weight
  169. property int is_on                // is the object turned on
  170. property int is_dark            // for locations -- is it dark
  171. property int is_vacuum            // for locations -- is it in vacuum
  172.  
  173. method int is_carried
  174. "You haven't got that.\n"
  175. {
  176.     return this in == player and not this is_worn
  177. }
  178.  
  179. method int is_visible
  180. "I don't see that here.\n"
  181. {
  182.     if this in == player or this in == player in
  183.         return 1
  184.     if not this in exists
  185.         return 0
  186.             // object is visible if its container is visible and its container
  187.             // is open
  188.     return (this in is_open) and (this in is_visible)
  189. }
  190.  
  191. // Selector method for METHOD GET -- like is_visible except that something
  192. // being carried is not gettable
  193.  
  194. method int is_gettable
  195. "It isn't there to take.\n"
  196. {
  197.     if this in == player in or (this in == player and this is_worn)
  198.         return 1
  199.     if not this in exists
  200.         return 0
  201.     return (this in is_open) and (this in is_visible)
  202. }
  203.  
  204. method tiger_death
  205. {
  206.     print "The tiger leaps at you, knocks you to the ground, breaks your "
  207.         "neck, rips you apart and eats you. If it's any consolation, it finds "
  208.         "the meat among the least tasty it's eaten in a very long time.\n"
  209.     exit
  210. }
  211.  
  212. // Method for doing background stuff like checking for death from vacuum etc.
  213. // Gets called by other methods after they've finished doing their bit.
  214.  
  215. method go
  216. {
  217.     if tiger_moved and tiger is_visible
  218.         this tiger_death
  219.     if tiger is_visible
  220.         tiger_moved = 1
  221.     if this in is_vacuum and not suit is_worn
  222.     {
  223.         print "You've always wondered why people seem to go to all the "
  224.             "trouble of putting on space suits before exposing themselves to "
  225.             "vacuum. Suddenly all is revealed. It's to prevent themselves "
  226.             "dying from explosive decompression. You realize this because you "
  227.             "are yourself dying from precisely this cause, having entered "
  228.             "vacuum without a space suit. On the whole, it probably wasn't "
  229.             "something that was worth dying to find out but there you are.\n"
  230.         exit
  231.     }
  232.     if this in is_dark and not (lamp is_visible and lamp is_on)
  233.     {
  234.         print "It's dark here underground without a source of light. Pitch "
  235.             "dark. You can't see where you're going and you stumble and gash "
  236.             "your space suit on a sharp rock. You die a messy and unpleasant "
  237.             "death.\n"
  238.         exit
  239.     }
  240.     if drunk
  241.     {
  242.         if drunk == 1
  243.             print "You are slightly drunk.\n"
  244.         if drunk == 2
  245.             print "You are reasonably drunk.\n"
  246.         if drunk == 3
  247.             print "You are fairly drunk.\n"
  248.         if drunk == 4
  249.             print "You are very drunk.\n"
  250.         if drunk == 5
  251.             print "You are extremely drunk.\n"
  252.         drunk = drunk - 1
  253.     }
  254. }
  255.  
  256. method list_contents
  257. {
  258.     object o
  259.     int how_many
  260.  
  261.     if not this is_open
  262.         return
  263.     o = object 1
  264.     do
  265.     {
  266.         if o in == this and o moved
  267.             how_many = how_many + 1
  268.         o = o next
  269.     }
  270.     while o exists
  271.     if how_many == 0
  272.         return
  273.     print "The "
  274.     print this word_desc
  275.     print " contains "
  276.     o = object 1
  277.     do
  278.     {
  279.         if o in == this and o moved
  280.         {
  281.             print o short_desc
  282.             how_many = how_many - 1
  283.             if how_many
  284.             {
  285.                 if how_many == 1
  286.                     print " and "
  287.                 else
  288.                     print ", "
  289.             }
  290.             else
  291.                 print ".\n"
  292.         }
  293.         o = o next
  294.     }
  295.     while o exists
  296.     o = object 1
  297.     do
  298.     {
  299.         if o in == this
  300.             o list_contents
  301.         o = o next
  302.     }
  303.     while o exists
  304. }
  305.  
  306. method int list_objects string initial_message
  307. {
  308.     object o
  309.     int how_many
  310.  
  311.     o = object 1
  312.     do
  313.     {
  314.         if o in == this and o moved
  315.             how_many = how_many + 1
  316.         o = o next
  317.     }
  318.     while o exists
  319.     if how_many == 0
  320.         return 0
  321.     print initial_message
  322.     o = object 1
  323.     do
  324.     {
  325.         if o in == this and o moved
  326.         {
  327.             print o short_desc
  328.             how_many = how_many - 1
  329.             if how_many
  330.             {
  331.                 if how_many == 1
  332.                     print " and "
  333.                 else
  334.                     print ", "
  335.             }
  336.             else
  337.                 print ".\n"
  338.         }
  339.         o = o next
  340.     }
  341.     while o exists
  342.     o = object 1
  343.     do
  344.     {
  345.         if o in == this and o moved
  346.             o list_contents
  347.         o = o next
  348.     }
  349.     while o exists
  350.     return 1
  351. }
  352.  
  353. // Method to describe current location to player -- the verbose_description
  354. // flag is used to indicate whether the full description should always be given
  355.  
  356. method describe_location int verbose_description
  357. {
  358.     object l
  359.     object o
  360.     int i
  361.  
  362.     l = this in
  363.     print l short_desc
  364.     print "\n"
  365.     if verbose_description or
  366.         (describe_mode != -1 and (describe_mode == 1 or not l moved))
  367.     {
  368.         l moved = 1
  369.         print l long_desc
  370.         print "\n"
  371.     }
  372.     if l == hangar
  373.         if hangar_vacuum
  374.             print "The roof is open.\n"
  375.         else
  376.             print "The roof is closed.\n"
  377.     o = object 1
  378.     do
  379.     {
  380.         if o in == l and not o moved and not o is player
  381.         {
  382.             print o long_desc
  383.             print "\n"
  384.             o list_contents
  385.         }
  386.         o = o next
  387.     }
  388.     while o exists
  389.     i = l list_objects "You can also see "
  390. }
  391.  
  392. method look verbs {{l} {look}}
  393. {
  394.     this describe_location 1
  395. }
  396.  
  397. method go_north verbs {{n} {north} {go north}}
  398. {
  399.     if this in == corridor10
  400.     {
  401.         if not drunk
  402.         {
  403.             print "You walk into the field. Suddenly you find that the "
  404.                 "corridor starts spinning around you. Finally it stops "
  405.                 "spinning and you find yourself facing back the way you "
  406.                 "came.\n"
  407.             this go
  408.             return
  409.         }
  410.         print "You lurch into the field. Suddenly you find that the corridor's "
  411.             "angular velocity increases dramatically. Finally it stops "
  412.             "spinning. Much to your surprise you find that it seems you've "
  413.             "actually got where you were going.\n"
  414.         this in = corridor11
  415.         this describe_location 0
  416.         this go
  417.         return
  418.     }
  419.     if not this in n exists
  420.     {
  421.         print "You can't go that way.\n"
  422.         return
  423.     }
  424.     if this in door exists
  425.         if this in door direction == 1 and not this in door is_open
  426.         {
  427.             print "You can't go through a locked door.\n"
  428.             return
  429.         }
  430.     this in = this in n
  431.     this describe_location 0
  432.     this go
  433. }
  434.  
  435. method go_south verbs {{s} {south} {go south}}
  436. {
  437.     if not this in s exists
  438.     {
  439.         print "You can't go that way.\n"
  440.         return
  441.     }
  442.     if this in door exists
  443.         if this in door direction == 2 and not this in door is_open
  444.         {
  445.             print "You can't go through a locked door.\n"
  446.             return
  447.         }
  448.     this in = this in s
  449.     this describe_location 0
  450.     this go
  451. }
  452.  
  453. method go_east verbs {{e} {east} {go east}}
  454. {
  455.     if not this in e exists
  456.     {
  457.         print "You can't go that way.\n"
  458.         return
  459.     }
  460.     if tiger is_visible
  461.         this tiger_death
  462.     if this in door exists
  463.         if this in door direction == 3 and not this in door is_open
  464.         {
  465.             print "You can't go through a locked door.\n"
  466.             return
  467.         }
  468.     this in = this in e
  469.     this describe_location 0
  470.     this go
  471. }
  472.  
  473. method go_west verbs {{w} {west} {go west}}
  474. {
  475.     if not this in w exists
  476.     {
  477.         print "You can't go that way.\n"
  478.         return
  479.     }
  480.     if tiger is_visible
  481.         this tiger_death
  482.     if this in door exists
  483.         if this in door direction == 4 and not this in door is_open
  484.         {
  485.             print "You can't go through a locked door.\n"
  486.             return
  487.         }
  488.     this in = this in w
  489.     this describe_location 0
  490.     this go
  491. }
  492.  
  493. method go_northeast verbs {{ne} {northeast} {go northeast}}
  494. {
  495.     if not this in ne exists
  496.     {
  497.         print "You can't go that way.\n"
  498.         return
  499.     }
  500.     this in = this in ne
  501.     this describe_location 0
  502.     this go
  503. }
  504.  
  505. method go_northwest verbs {{nw} {northwest} {go northwest}}
  506. {
  507.     if not this in nw exists
  508.     {
  509.         print "You can't go that way.\n"
  510.         return
  511.     }
  512.     this in = this in nw
  513.     this describe_location 0
  514.     this go
  515. }
  516.  
  517. method go_southeast verbs {{se} {southeast} {go southeast}}
  518. {
  519.     if not this in se exists
  520.     {
  521.         print "You can't go that way.\n"
  522.         return
  523.     }
  524.     this in = this in se
  525.     this describe_location 0
  526.     this go
  527. }
  528.  
  529. method go_southwest verbs {{sw} {southwest} {go southwest}}
  530. {
  531.     if not this in sw exists
  532.     {
  533.         print "You can't go that way.\n"
  534.         return
  535.     }
  536.     this in = this in sw
  537.     this describe_location 0
  538.     this go
  539. }
  540.  
  541. method go_up verbs {{u} {up} {go up}}
  542. {
  543.     if this in == hangar
  544.     {
  545.         if not ladder is_gettable
  546.         {
  547.             print "The airlock is too high up for you to reach.\n"
  548.             return
  549.         }
  550.         this in = airlock2
  551.         this describe_location 0
  552.         this go
  553.         return
  554.     }
  555.     if not this in up exists
  556.     {
  557.         print "You can't go that way.\n"
  558.         return
  559.     }
  560.     if this in door exists
  561.         if this in door direction == 9 and not this in door is_open
  562.         {
  563.             print "You can't go through a locked door.\n"
  564.             return
  565.         }
  566.     this in = this in up
  567.     this describe_location 0
  568.     this go
  569. }
  570.  
  571. method go_down verbs {{d} {down} {go down}}
  572. {
  573.     if not this in down exists
  574.     {
  575.         print "You can't go that way.\n"
  576.         return
  577.     }
  578.     if this in door exists
  579.         if this in door direction == 10 and not this in door is_open
  580.         {
  581.             print "You can't go through a locked door.\n"
  582.             return
  583.         }
  584.     this in = this in down
  585.     this describe_location 0
  586.     this go
  587. }
  588.  
  589. // Method to calculate total weight of object, which is object's own weight
  590. // plus weight of all objects inside it and inside those etc.
  591.  
  592. method int total_weight
  593. {
  594.     object o
  595.     int result
  596.  
  597.     result = this weight
  598.     o = object 1
  599.     do
  600.     {
  601.         if o in == this
  602.             result = result + o total_weight
  603.         o = o next
  604.     }
  605.     while o exists
  606.     return result
  607. }
  608.  
  609. method get object x is_gettable
  610.     verbs {{get x} {take x} {pick up x} {pick x up} {remove x} {take off x}
  611.         {take x off}}
  612. {
  613.     if x is_worn
  614.     {
  615.         print "Removed.\n"
  616.         x is_worn = 0
  617.         return
  618.     }
  619.     if x weight == 9999 or x is whisky
  620.     {
  621.         print "You can't take that.\n"
  622.         return
  623.     }
  624.     if this total_weight + x total_weight > 3000
  625.     {
  626.         print "You're carrying too much already.\n"
  627.         return
  628.     }
  629.     if (x is drive or x is computer) and drive_connected
  630.     {
  631.         drive_connected = 0
  632.         if computer is_on
  633.         {
  634.             print "(You turn off the computer.)\n"
  635.             computer is_on = 0
  636.         }
  637.         print "(You disconnect the disk drive.)\n"
  638.     }
  639.     if (x is computer) and computer_connected
  640.     {
  641.         computer_connected = 0
  642.         if computer is_on
  643.         {
  644.             print "(You turn off the computer.)\n"
  645.             computer is_on = 0
  646.         }
  647.         print "(You disconnect the computer.)\n"
  648.     }
  649.     x in = this
  650.     x moved = 1
  651.     print "Taken.\n"
  652.     if x is pan and not pan_moved
  653.     {
  654.         pan_moved = 1
  655.         print "Underneath the pan you uncover a metal key.\n"
  656.         metal_key in = this in
  657.     }
  658.     this go
  659. }
  660.  
  661. method drop object x is_carried verbs {{drop x} {put down x} {put x down}}
  662. {
  663.     x in = this in
  664.     x is_worn = 0
  665.     print "Dropped.\n"
  666.     this go
  667. }
  668.  
  669. method put_in object x is_carried object y is_visible
  670.     verbs {{put x in y} {put x into y}}
  671. {
  672.     if x == y
  673.     {
  674.         print "You can't put something into itself!\n"
  675.         return
  676.     }
  677.     if y is socket or y is computer
  678.     {
  679.         print "Try CONNECT (object) TO (object).\n"
  680.         return
  681.     }
  682.     if not y is box and not y is safe and not y is drive
  683.     {
  684.         print "You can't put things in that.\n"
  685.         return
  686.     }
  687.     if not y is_open
  688.     {
  689.         print "It isn't open.\n"
  690.         return
  691.     }
  692.     if y is drive
  693.     {
  694.         if not x is disk
  695.         {
  696.             print "You can only put floppy disks in a floppy disk drive.\n"
  697.             return
  698.         }
  699.         x in = y
  700.         print "OK, you put the disk into the disk drive.\n"
  701.         this go
  702.         return
  703.     }
  704.     print "OK.\n"
  705.     x in = y
  706.     x is_worn = 0
  707.     this go
  708. }
  709.  
  710. method quit verbs {{quit}}
  711. {
  712.     quit
  713. }
  714.  
  715. method inventory verbs {{i} {inv} {inventory}}
  716. {
  717.     if not this list_objects "You are carrying "
  718.         print "You are emptyhanded.\n"
  719. }
  720.  
  721. method save verbs {{save}}
  722. {
  723.     save
  724. }
  725.  
  726. method load verbs {{load} {restore}}
  727. {
  728.     if load
  729.     {
  730.         this describe_location 0
  731.         this inventory
  732.     }
  733. }
  734.  
  735. method examine object x is_visible
  736.      verbs {{examine x} {look at x} {search x} {read x} {look under x}
  737.         {search under x}}
  738. {
  739.     if x examine_desc != null_string
  740.     {
  741.         print x examine_desc
  742.         print "\n"
  743.     }
  744.     if x is door
  745.     {
  746.         if x is_open
  747.             print "The door is unlocked.\n"
  748.         else
  749.             print "The door is locked.\n"
  750.     }
  751.     if x is box
  752.     {
  753.         if x is_open
  754.             print "The box is open.\n"
  755.         else
  756.             print "The box is closed.\n"
  757.     }
  758.     if x is desk and not desk_moved
  759.     {
  760.         desk_moved = 1
  761.         print "Underneath the desk you uncover a plastic key.\n"
  762.         plastic_key in = this in
  763.         this go
  764.     }
  765.     if x is pan and not pan_moved
  766.     {
  767.         pan_moved = 1
  768.         print "Underneath the pan you uncover a metal key.\n"
  769.         metal_key in = this in
  770.         this go
  771.     }
  772.     if x is safe
  773.     {
  774.         if x is_open
  775.             print "The safe is open.\n"
  776.         else
  777.             print "The safe is shut.\n"
  778.     }
  779.     if (x is socket and computer_connected) or (x is drive and drive_connected)
  780.         print "It's connected to the computer.\n"
  781.     if x is computer and drive_connected and not computer_connected
  782.         print "It's connected to the disk drive.\n"
  783.     if x is computer and computer_connected and not drive_connected
  784.         print "It's connected to the communications socket.\n"
  785.     if x is computer and computer_connected and drive_connected
  786.         print "It's connected to the disk drive and the communications socket.\n"
  787.     if x is_on
  788.         print "It's switched on.\n"
  789.     if (x is lamp or x is computer) and not x is_on
  790.         print "It's switched off.\n"
  791.     x list_contents
  792. }
  793.  
  794. method wear object x is_carried verbs {{wear x} {put on x} {put x on}}
  795. {
  796.     if not x is mask and not x is suit
  797.     {
  798.         print "You can't wear that!\n"
  799.         return
  800.     }
  801.     if x is_worn
  802.     {
  803.         print "You're already wearing it.\n"
  804.         return
  805.     }
  806.     print "OK.\n"
  807.     x is_worn = 1
  808.     this go
  809. }
  810.  
  811. method press object x is_visible
  812.     verbs {{press x} {push x} {move x} {shove x} {slide x}}
  813. {
  814.     if x is button
  815.     {
  816.         print "Your surroundings seem to shift slightly.\n"
  817.         if this in == hangar_teleport
  818.             this in = canyon_teleport
  819.         else
  820.             this in = hangar_teleport
  821.         this describe_location 0
  822.         this go
  823.         return
  824.     }
  825.     if x is desk and not desk_moved
  826.     {
  827.         desk_moved = 1
  828.         print "Underneath the desk you uncover a plastic key.\n"
  829.         plastic_key in = this in
  830.         this go
  831.         return
  832.     }
  833.     if x is pan and not pan_moved
  834.     {
  835.         pan_moved = 1
  836.         print "Underneath the pan you uncover a metal key.\n"
  837.         metal_key in = this in
  838.         this go
  839.         return
  840.     }
  841.     print "Nothing happens.\n"
  842.     this go
  843. }
  844.  
  845. method use object x is_visible verbs {{use x}}
  846. {
  847.     if x == lamp
  848.     {
  849.         print "Try TURN ON LAMP.\n"
  850.         return
  851.     }
  852.     if x == torch
  853.     {
  854.         print "Try BURN (object) WITH TORCH.\n"
  855.         return
  856.     }
  857.     if x == detonator or x == explosive
  858.     {
  859.         print "Get the explosive and the detonator and type BLOW UP "
  860.             "(object).\n"
  861.         return
  862.     }
  863.     if x == plastic_key or x == metal_key or x == ceramic_key
  864.     {
  865.         print "Open things with it.\n"
  866.         return
  867.     }
  868.     if x == suit
  869.     {
  870.         print "PUT ON SUIT and you can then go into vacuum.\n"
  871.         return
  872.     }
  873.     if x == mask
  874.     {
  875.         print "PUT ON MASK to protect yourself from toxic gases.\n"
  876.         return
  877.     }
  878.     if x == whisky
  879.     {
  880.         print "Well, what do people usually do with whisky??\n"
  881.         return
  882.     }
  883.     if x == disk
  884.     {
  885.         print "You'll have to put it into a disk drive, then turn on "
  886.             "the computer.\n"
  887.         return
  888.     }
  889.     if x == drive
  890.     {
  891.         print "You'll have to connect it to a computer then turn on "
  892.             "the computer.\n"
  893.         return
  894.     }
  895.     if x == computer
  896.     {
  897.         print "Connect up all the required peripherals then TURN ON "
  898.             "COMPUTER. The power supply is built in, as is the screen.\n"
  899.         return
  900.     }
  901.     if x == socket
  902.     {
  903.         print "You connect a computer to it to obtain communications "
  904.             "facilities.\n"
  905.         return
  906.     }
  907.     if x == ladder
  908.     {
  909.         print "When in an appropriate place, PUT DOWN LADDER and then "
  910.             "GO UP.\n"
  911.         return
  912.     }
  913.     if x == shovel
  914.     {
  915.         print "Have the shovel to hand and type DIG in the appropriate "
  916.             "circumstances.\n"
  917.         return
  918.     }
  919.     print "Sorry, but you'll have to use some other verb.\n"
  920. }
  921.  
  922. method open object x is_visible verbs {{open x} {unlock x}}
  923. {
  924.     object o
  925.  
  926.     if not x is box and not x is door and not x is safe
  927.     {
  928.         print "You can't open that.\n"
  929.         return
  930.     }
  931.     if x is_open
  932.     {
  933.         print "It's already open.\n"
  934.         return
  935.     }
  936.     if x is box
  937.     {
  938.         x is_open = 1
  939.         x moved = 1
  940.         o = object 1
  941.         do
  942.         {
  943.             if o in == x and o is box
  944.             {
  945.                 print "You open the box and remove another, smaller box.\n"
  946.                 o in = this in
  947.                 this go
  948.                 return
  949.             }
  950.             o = o next
  951.         }
  952.         while o exists
  953.         print "You open the box and remove an American Express credit card and "
  954.             "an oxy-acetylene torch.\n"
  955.         card in = this in
  956.         torch in = this in
  957.         this go
  958.         return
  959.     }
  960.     if x is door and (this in == airlock or this in == crater)
  961.     {
  962.         print "You'll have to type in the access code to open the door - try "
  963.             "TYPE (code).\n"
  964.         return
  965.     }
  966.     print "You'll have to tell me what you want to open it with.\n"
  967. }
  968.  
  969. method do_open_door
  970. {
  971.     this door is_open = 1
  972.     this door long_desc = "The door is unlocked."
  973. }
  974.  
  975. method open_door
  976. {
  977.     int dir
  978.  
  979.     this do_open_door
  980.     dir = this door direction
  981.     if dir == 1
  982.         this n do_open_door
  983.     if dir == 2
  984.         this s do_open_door
  985.     if dir == 3
  986.         this e do_open_door
  987.     if dir == 4
  988.         this w do_open_door
  989.     if dir == 9
  990.         this up do_open_door
  991.     if dir == 10
  992.         this down do_open_door
  993. }
  994.  
  995. method open_with object x is_visible object y is_carried
  996.     verbs {{open x with y} {unlock x with y}}
  997. {
  998.     object l
  999.  
  1000.     if not x is box and not x is door and not x is safe
  1001.     {
  1002.         print "You can't open that.\n"
  1003.         return
  1004.     }
  1005.     if x is_open
  1006.     {
  1007.         print "It's already open.\n"
  1008.         return
  1009.     }
  1010.     if x is box
  1011.     {
  1012.         this open x
  1013.         return
  1014.     }
  1015.     if x is door and (this in == airlock or this in == crater)
  1016.     {
  1017.         print "You'll have to type in the access code to open the door - try "
  1018.             "TYPE (code).\n"
  1019.         return
  1020.     }
  1021.     if x is safe
  1022.     {
  1023.         if y is metal_key
  1024.         {
  1025.             print "You open the safe.\n"
  1026.             safe is_open = 1
  1027.             safe list_contents
  1028.             this go
  1029.             return
  1030.         }
  1031.         print "That won't open the safe.\n"
  1032.         return
  1033.     }
  1034.     l = this in
  1035.     if l == control_room or l == corridor1 or l == corridor3 or l == office2
  1036.     {
  1037.         if y is card
  1038.         {
  1039.             print "You manage to unlock the door with the credit card.\n"
  1040.             this in open_door
  1041.             this go
  1042.             return
  1043.         }
  1044.         print "That won't unlock the door.\n"
  1045.         this go
  1046.         return
  1047.     }
  1048.     if l == explosive_store or l == chemical_store or l == corridor5 or
  1049.         l == corridor6
  1050.     {
  1051.         if y is ceramic_key
  1052.         {
  1053.             print "You unlock the door.\n"
  1054.             this in open_door
  1055.             this go
  1056.             return
  1057.         }
  1058.         print "That won't unlock the door.\n"
  1059.         this go
  1060.         return
  1061.     }
  1062.     if l == canyon_north or l == canyon_teleport
  1063.     {
  1064.         if y is metal_key
  1065.         {
  1066.             print "You unlock the door.\n"
  1067.             this in open_door
  1068.             this go
  1069.             return
  1070.         }
  1071.         print "That won't unlock the door.\n"
  1072.         this go
  1073.         return
  1074.     }
  1075.     if l == corridor8 or l == storage_compartment or l == corridor17 or
  1076.         l == control_room2
  1077.     {
  1078.         if y is plastic_key
  1079.         {
  1080.             print "You unlock the door.\n"
  1081.             this in open_door
  1082.             this go
  1083.             return
  1084.         }
  1085.     }
  1086.     print "That won't unlock the door.\n"
  1087.     this go
  1088.     return
  1089. }
  1090.  
  1091. method do_close_door
  1092. {
  1093.     this door is_open = 0
  1094.     this door long_desc = "The door is locked.\n"
  1095. }
  1096.  
  1097. method close_door
  1098. {
  1099.     int dir
  1100.  
  1101.     this do_close_door
  1102.     dir = this door direction
  1103.     if dir == 1
  1104.         this n do_close_door
  1105.     if dir == 2
  1106.         this s do_close_door
  1107.     if dir == 3
  1108.         this e do_close_door
  1109.     if dir == 4
  1110.         this w do_close_door
  1111.     if dir == 9
  1112.         this up do_close_door
  1113.     if dir == 10
  1114.         this down do_close_door
  1115. }
  1116.  
  1117. method close object x is_visible verbs {{close x} {shut x} {lock x}}
  1118. {
  1119.     if x is box
  1120.     {
  1121.         print "These are disposable cardboard boxes, you can't close them "
  1122.             "again.\n"        // We're being lazy here!
  1123.         return
  1124.     }
  1125.     if not x is door and not x is safe
  1126.     {
  1127.         print "You can't close that.\n"
  1128.         return
  1129.     }
  1130.     if not x is_open
  1131.     {
  1132.         print "It isn't open.\n"
  1133.         return
  1134.     }
  1135.     if x is safe
  1136.     {
  1137.         print "The safe door slams shut.\n"
  1138.         x is_open = 0
  1139.         this go
  1140.         return
  1141.     }
  1142.     if this in == corridor9 or this in == locker
  1143.     {
  1144.         print "The lock on the door doesn't work anymore.\n"
  1145.         this go
  1146.         return
  1147.     }
  1148.     print "You lock the door.\n"
  1149.     this in close_door
  1150.     this go
  1151. }
  1152.  
  1153. method close_with object x is_visible object y is_carried
  1154.     verbs {{close x with y} {shut x with y} {lock x with y}}
  1155. {
  1156.     this close x
  1157. }
  1158.  
  1159. method help verbs {{help}}
  1160. {
  1161.     print "Wise up man, nobody except Infocom has given online help in an "
  1162.         "adventure game since the early eighties and Infocom only did "
  1163.         "it cause they had loads of money to spend on development. "
  1164.         "Contact the author if you're really stuck, or of course you "
  1165.         "can always look at the source code. (OK, if you're really "
  1166.         "stuck for a phrase, try USE (object), it might point you "
  1167.         "in the right direction).\n"
  1168. }
  1169.  
  1170. method give object x is_carried verbs {{give x} {show x} {offer x}}
  1171. {
  1172.     print "You'll have to tell me what you want to give it to.\n"
  1173. }
  1174.  
  1175. method give_to object x is_carried object y is_visible
  1176.     verbs {{give x to y} {show x to y} {offer x to y}
  1177.         {give y x} {show y x} {offer y x}}
  1178. {
  1179.     if not y is tiger or not x is herring
  1180.     {
  1181.         print "It doesn't seem to want the "
  1182.         print x word_desc
  1183.         print ".\n"
  1184.         this go
  1185.         return
  1186.     }
  1187.     print "You toss the herring on the floor in front of the tiger. The tiger "
  1188.         "sniffs suspiciously at the fish, then grabs it and gobbles it down. "
  1189.         "It licks its lips and yawns as if to say, \"Thanks for the appetizer!\" "
  1190.         "and steps towards you. Suddenly it stops and starts gagging. It curls "
  1191.         "up into a ball, foams at the mouth and dies. Ideas for blackmailing "
  1192.         "the cook start flooding into your mind.\n"
  1193.     destroy herring
  1194.     destroy tiger
  1195.     this go
  1196. }
  1197.  
  1198. method eat object x is_carried verbs {{eat x}}
  1199. {
  1200.     if not x is herring
  1201.     {
  1202.         print "It doesn't look very edible to me.\n"
  1203.         return
  1204.     }
  1205.     print "OK, you eat the herring. It tastes totally horrible. Suddenly you "
  1206.         "get a terrible pain in your stomach. You start throwing up. Now you "
  1207.         "can't breathe. The last thought that flashes through your mind is "
  1208.         "how much money you could sue the cook for.\n"
  1209.     exit
  1210. }
  1211.  
  1212. method feed object x is_visible verbs {{feed x}}
  1213. {
  1214.     if not x is tiger
  1215.     {
  1216.         print "It doesn't look very hungry to me.\n"
  1217.         return
  1218.     }
  1219.     if not herring is_carried
  1220.     {
  1221.         print "You have nothing edible.\n"
  1222.         return
  1223.     }
  1224.     this give_to herring tiger
  1225. }
  1226.  
  1227. method connect_to object x is_visible object y is_visible
  1228.     verbs {{connect x to y} {plug x into y} {connect x and y} {connect x with y}}
  1229. {
  1230.     if not (x is drive and y is computer) and not (x is computer and y is drive)
  1231.         and not (x is socket and y is computer) and
  1232.         not (x is computer and y is socket)
  1233.     {
  1234.         print "You can't connect those things.\n"
  1235.         return
  1236.     }
  1237.     if x in != this in or y in != this in
  1238.     {
  1239.         print "You'll have to put it down first.\n"
  1240.         return
  1241.     }
  1242.     if x is drive or y is drive
  1243.     {
  1244.         if drive_connected
  1245.         {
  1246.             print "The disk drive is already plugged into the computer.\n"
  1247.             return
  1248.         }
  1249.         drive_connected = 1
  1250.         print "OK, you plug the disk drive into the computer.\n"
  1251.         this go
  1252.         return
  1253.     }
  1254.     if computer_connected
  1255.     {
  1256.         print "The computer is already plugged into the socket.\n"
  1257.         return
  1258.     }
  1259.     computer_connected = 1
  1260.     print "OK, you plug the computer into the socket.\n"
  1261.     this go
  1262. }
  1263.  
  1264. method connect object x is_visible verbs {{connect x} {plug x in} {plug in x}}
  1265. {
  1266.     print "You'll have to tell me what you want to connect it to.\n"
  1267. }
  1268.  
  1269. method disconnect_computer
  1270. {
  1271.     if not computer_connected
  1272.     {
  1273.         print "The computer isn't connected to a communications socket.\n"
  1274.         return
  1275.     }
  1276.     computer_connected = 0
  1277.     if computer is_on
  1278.     {
  1279.         print "(You turn off the computer.)\n"
  1280.         computer is_on = 0
  1281.     }
  1282.     print "OK, you disconnect the computer from the communications socket.\n"
  1283.     this go
  1284. }
  1285.  
  1286. method disconnect_drive
  1287. {
  1288.     if not drive_connected
  1289.     {
  1290.         print "The disk drive isn't connected to anything.\n"
  1291.         return
  1292.     }
  1293.     drive_connected = 0
  1294.     if computer is_on
  1295.     {
  1296.         print "(You turn off the computer.)\n"
  1297.         computer is_on = 0
  1298.     }
  1299.     print "OK, you disconnect the disk drive from the computer.\n"
  1300.     this go
  1301. }
  1302.  
  1303. method disconnect object x is_visible verbs {{disconnect x} {unplug x}}
  1304. {
  1305.     if not x is computer and not x is drive and not x is socket
  1306.     {
  1307.         print "That isn't connected to anything.\n"
  1308.         return
  1309.     }
  1310.     if x is socket
  1311.         this disconnect_computer
  1312.     if x is drive
  1313.         this disconnect_drive
  1314.     if x is computer
  1315.     {
  1316.         if drive_connected
  1317.         {
  1318.             this disconnect_drive
  1319.             return
  1320.         }
  1321.         if computer_connected
  1322.         {
  1323.             this disconnect_computer
  1324.             return
  1325.         }
  1326.         print "The computer isn't connected to anything.\n"
  1327.     }
  1328. }
  1329.  
  1330. method disconnect_from object x is_visible object y is_visible
  1331.     verbs {{disconnect x from y} {disconnect x and y} {unplug x from y}}
  1332. {
  1333.     if ((x is drive and y is computer) or (x is computer and y is drive))
  1334.         and drive_connected
  1335.     {
  1336.         this disconnect_drive
  1337.         return
  1338.     }
  1339.     if ((x is socket and y is computer) or (x is computer and y is socket))
  1340.         and computer_connected
  1341.     {
  1342.         this disconnect_computer
  1343.         return
  1344.     }
  1345.     print "Those things aren't connected.\n"
  1346. }
  1347.  
  1348. method drink object x is_visible verbs {{drink x}}
  1349. {
  1350.     if not x is whisky
  1351.     {
  1352.         print "You can't drink that.\n"
  1353.         return
  1354.     }
  1355.     destroy x
  1356.     print "Glug ... glug ... glug ... hic!\n"
  1357.     drunk = 5
  1358.     this go
  1359. }
  1360.  
  1361. method brief verbs {{brief}}
  1362. {
  1363.     print "Brief descriptions only.\n"
  1364.     describe_mode = -1
  1365. }
  1366.  
  1367. method verbose verbs {{verbose}}
  1368. {
  1369.     print "Verbose descriptions.\n"
  1370.     describe_mode = 1
  1371. }
  1372.  
  1373. method normal verbs {{normal}}
  1374. {
  1375.     print "Normal descriptions.\n"
  1376.     describe_mode = 0
  1377. }
  1378.  
  1379. method turn_on object x is_visible
  1380.     verbs {{turn on x} {turn x on} {light x} {switch x on} {switch on x}}
  1381. {
  1382.     if x is_on
  1383.     {
  1384.         print "It's already on.\n"
  1385.         return
  1386.     }
  1387.     if not x is computer and not x is lamp
  1388.     {
  1389.         print "You can't turn that on.\n"
  1390.         return
  1391.     }
  1392.     if x is lamp
  1393.     {
  1394.         x is_on = 1
  1395.         print "You turn on the lamp. Light floods the area.\n"
  1396.         this go
  1397.         return
  1398.     }
  1399.     if not drive_connected
  1400.     {
  1401.         print "You press the ON button on the computer. The screen lights "
  1402.             "up and the machine beeps apologetically at you. The following "
  1403.             "message appears on the screen:\n\n"
  1404.             "HARDWARE ERROR - MASS STORAGE ACCESS FAILURE. SYSTEM HALTED.\n\n"
  1405.             "The computer switches itself off again.\n"
  1406.         this go
  1407.         return
  1408.     }
  1409.     if disk in != drive
  1410.     {
  1411.         print "You press the ON button on the computer. The screen lights up, "
  1412.             "the disk drive activates for a moment and the machine beeps "
  1413.             "apologetically at you. The following message appears on the "
  1414.             "screen:\n\n"
  1415.             "ERROR - INVALID BOOT DISK. SYSTEM HALTED.\n\n"
  1416.             "The computer switches itself off again.\n"
  1417.         this go
  1418.         return
  1419.     }
  1420.     if not computer_connected
  1421.     {
  1422.         print "You press the ON button on the computer. The screen lights up "
  1423.             "and the disk drive activates. Eventually the machine beeps "
  1424.             "apologetically at you. The following message appears on the "
  1425.             "screen:\n\n"
  1426.             "HARDWARE ERROR - COMMUNICATIONS PORT ACCESS FAILURE. "
  1427.             "SYSTEM HALTED.\n\n"
  1428.             "The computer switches itself off again.\n"
  1429.         this go
  1430.         return
  1431.     }
  1432.     if not hangar_vacuum
  1433.     {
  1434.         hangar_vacuum = 1
  1435.         print "You press the ON button on the computer. The screen lights up "
  1436.             "and the disk drive activates. Eventually the following appears "
  1437.             "on the screen:\n\n"
  1438.             "PROGRAM EXECUTING -- OPENING HANGAR DOOR.\n"
  1439.             "WARNING - AREA NOW IN VACUUM.\n\n"
  1440.             "You hear a distant whirring noise. All the air is suddenly "
  1441.             "sucked from the room.\n"
  1442.         hangar_teleport is_vacuum = 1
  1443.         hangar is_vacuum = 1
  1444.         corridor19 is_vacuum = 1
  1445.         computer_room is_vacuum = 1
  1446.         this go
  1447.         return
  1448.     }
  1449.     hangar_vacuum = 0
  1450.     print "You press the ON button on the computer. The screen lights up "
  1451.         "and the disk drive activates. Eventually the following appears "
  1452.         "on the screen:\n\n"
  1453.         "PROGRAM EXECUTING -- CLOSING HANGAR DOOR.\n\n"
  1454.         "You hear a distant whirring noise. The air suddenly rushes back into "
  1455.         "the room.\n"
  1456.     hangar_teleport is_vacuum = 0
  1457.     hangar is_vacuum = 0
  1458.     corridor19 is_vacuum = 0
  1459.     computer_room is_vacuum = 0
  1460.     this go
  1461. }
  1462.  
  1463. method turn_off object x is_visible
  1464.     verbs {{turn off x} {turn x off} {switch off x} {switch off x}}
  1465. {
  1466.     if not x is_on
  1467.     {
  1468.         print "It isn't turned on.\n"
  1469.         return
  1470.     }
  1471.     print "Click.\n"
  1472.     x is_on = 0
  1473.     this go
  1474. }
  1475.  
  1476. method kill        // Method to destroy an object plus all its contents
  1477. {
  1478.     object o
  1479.     object o2
  1480.  
  1481.     o = object 1
  1482.     do
  1483.     {
  1484.         o2 = o next
  1485.         if o in == this
  1486.             o kill
  1487.         o = o2
  1488.     }
  1489.     while o exists
  1490.     destroy this
  1491. }
  1492.  
  1493. // Method to destroy door in this location plus the corresponding door in the
  1494. // next location
  1495.  
  1496. method destroy_door
  1497. {
  1498.     int dir
  1499.  
  1500.     dir = this door direction
  1501.     destroy this door
  1502.     if dir == 1
  1503.         destroy this n door
  1504.     if dir == 2
  1505.         destroy this s door
  1506.     if dir == 3
  1507.         destroy this e door
  1508.     if dir == 4
  1509.         destroy this w door
  1510.     if dir == 9
  1511.         destroy this up door
  1512.     if dir == 10
  1513.         destroy this down door
  1514. }
  1515.  
  1516. method blow_up object x is_visible
  1517.     verbs {{blow up x} {blow x up} {demolish x}}
  1518. {
  1519.     if not explosive is_carried
  1520.     {
  1521.         print "You haven't got any explosive.\n"
  1522.         return
  1523.     }
  1524.     if not detonator is_carried
  1525.     {
  1526.         print "The plastic explosive can only be set off by a special "
  1527.             "detonator which you haven't got.\n"
  1528.         return
  1529.     }
  1530.     if x in != this in
  1531.     {
  1532.         print "You'll have to put it on the ground first.\n"
  1533.         return
  1534.     }
  1535.     print "You put the detonator and explosive together and retreat to a "
  1536.         "safe distance. There is a massive explosion. The "
  1537.     print x word_desc
  1538.     print " is now destroyed.\n"
  1539.     if x is explosive or x is detonator
  1540.     {
  1541.         explosive kill
  1542.         detonator kill
  1543.         this go
  1544.         return
  1545.     }
  1546.     explosive kill
  1547.     detonator kill
  1548.     if x == this in door
  1549.     {
  1550.         this in destroy_door
  1551.         if this in == airlock
  1552.             this in is_vacuum = 1
  1553.         this go
  1554.         return
  1555.     }
  1556.     if x is computer or x is drive
  1557.         drive_connected = 0
  1558.     x kill
  1559.     this go
  1560. }
  1561.  
  1562. method blow_up_with object x is_visible object y is_carried
  1563.     verbs {{blow up x with y} {blow x up with y} {demolish x with y}}
  1564. {
  1565.     if not y is explosive
  1566.     {
  1567.         print "You can't blow things up with that.\n"
  1568.         return
  1569.     }
  1570.     this blow_up x
  1571. }
  1572.  
  1573. method cut object x is_visible
  1574.     verbs {{cut x} {burn x} {melt x} {cut through x} {burn through x}}
  1575. {
  1576.     if not torch is_carried
  1577.     {
  1578.         print "You haven't got the required equipment.\n"
  1579.         return
  1580.     }
  1581.     if x is safe
  1582.     {
  1583.         print "The torch fails to make much impression on the safe.\n"
  1584.         this go
  1585.         return
  1586.     }
  1587.     if x is tiger
  1588.     {
  1589.         print "You attack the tiger with the torch. Unfortunately the torch "
  1590.             "contains a built-in safety device which causes it to shut off "
  1591.             "when pointed at an organic life form. This tends to slightly "
  1592.             "limit its usefulness as a weapon. You feel slightly embarrassed "
  1593.             "when you discover this as you point the torch at the tiger and "
  1594.             "nothing happens. You feel even more embarrassed when the tiger "
  1595.             "kills you.\n"
  1596.         exit
  1597.     }
  1598.     if x is rubble
  1599.     {
  1600.         print "The torch fails to make much impression on the rubble.\n"
  1601.         this go
  1602.         return
  1603.     }
  1604.     if not x is door
  1605.     {
  1606.         if x in != this in
  1607.         {
  1608.             print "You'll have to put it on the ground first.\n"
  1609.             return
  1610.         }
  1611.         print "OK, you destroy the "
  1612.         print x word_desc
  1613.         print ".\n"
  1614.         if x is computer or x is drive or x is socket
  1615.         {
  1616.             computer_connected = 0
  1617.             drive_connected = 0
  1618.         }
  1619.         x kill
  1620.         this go
  1621.         return
  1622.     }
  1623.     if (this in == corridor9 or this in == locker)
  1624.         if this in door is_open
  1625.         {
  1626.             print "The door here is already open.\n"
  1627.             return
  1628.         }
  1629.     if this in == corridor9
  1630.     {
  1631.         print "You melt the padlock with the torch. The door swings open.\n"
  1632.         this in open_door
  1633.         this go
  1634.         return
  1635.     }
  1636.     print "The torch fails to make much impression on the door.\n"
  1637.     this go
  1638. }
  1639.  
  1640. method cut_with object x is_visible object y is_carried
  1641.     verbs {{cut x with y} {burn x with y} {melt x with y} {cut through x with y}
  1642.     {burn through x with y}}
  1643. {
  1644.     if y is explosive
  1645.     {
  1646.         print "Try BLOW UP.\n"
  1647.         return
  1648.     }
  1649.     if not y is torch
  1650.     {
  1651.         print "You can't damage it with that.\n"
  1652.         return
  1653.     }
  1654.     this cut x
  1655. }
  1656.  
  1657. method dig verbs {{dig}}
  1658. {
  1659.     if not rubble is_visible
  1660.     {
  1661.         print "There's nothing here to dig.\n"
  1662.         return
  1663.     }
  1664.     if not shovel is_carried
  1665.     {
  1666.         print "You've nothing to dig with.\n"
  1667.         return
  1668.     }
  1669.     print "After a couple of hours of hard work, you dig away the rubble "
  1670.         "with the shovel.\n"
  1671.     destroy rubble
  1672.     tunnel1 e = tunnel2
  1673.     this go
  1674. }
  1675.  
  1676. method dig_x object x is_visible verbs {{dig x} {clear x}}
  1677. {
  1678.     print "Just use DIG.\n"
  1679. }
  1680.  
  1681. method dig_x_with object x is_visible object y is_carried
  1682.     verbs {{dig x with y} {clear x with y}}
  1683. {
  1684.     print "Just use DIG.\n"
  1685. }
  1686.  
  1687. method type int number verbs {{type number} {enter number} {key number}}
  1688. {
  1689.     if this in != airlock and this in != crater and this in != control_room2
  1690.     {
  1691.         print "There's nothing around here to type numbers on.\n"
  1692.         return
  1693.     }
  1694.     if this in == control_room2
  1695.     {
  1696.         if number != 3142
  1697.         {
  1698.             print "You hear a loud BEEP and a message flashes on the screen: "
  1699.                 "INCORRECT AUTHORIZATION CODE.\n"
  1700.             this go
  1701.             return
  1702.         }
  1703.         if not hangar_vacuum
  1704.         {
  1705.             print "The engines start, the ship lifts from the ground and "
  1706.                 "slams into the roof of the hangar. The structure "
  1707.                 "crumples like a paper dart smashed into a wall. The nuclear "
  1708.                 "reactor explodes, demolishing the hangar and burying the "
  1709.                 "wreckage under thousands of tons of rubble.\n"
  1710.             exit
  1711.         }
  1712.         print "The engines start, the ship lifts from the ground and heads "
  1713.             "for the sky. At the required distance from the planet's gravity "
  1714.             "field the faster-than-light drive engages and you are on your "
  1715.             "way home. Well done.\n"
  1716.         exit        // Success!
  1717.     }
  1718.     if number != 7648
  1719.     {
  1720.         print "A sign flashes: \"INCORRECT ACCESS CODE\".\n"
  1721.         this go
  1722.         return
  1723.     }
  1724.     if this in door is_open
  1725.     {
  1726.         print "Nothing happens, on the grounds that the airlock door is "
  1727.             "already unlocked. (It can be locked manually, just type LOCK "
  1728.             "DOOR.)\n"
  1729.         this go
  1730.         return
  1731.     }
  1732.     print "The door is now unlocked.\n"
  1733.     this in open_door
  1734.     this go
  1735. }
  1736.  
  1737. method type_on int number object x is_visible
  1738.     verbs {{type number on x} {enter number on x} {key number on x}}
  1739. {
  1740.     print "Just use TYPE (code).\n"
  1741. }
  1742.  
  1743. method create_other_door int direction
  1744. {
  1745.     this door = create door
  1746.     this door direction = direction
  1747.     this door long_desc = "The door is locked."
  1748.     this door word_desc = "door"
  1749.     this door weight = 9999
  1750.     this door in = this
  1751. }
  1752.  
  1753. // Method to create a door in a location together with the corresponding door
  1754. // in the next location
  1755.  
  1756. method create_door int direction
  1757. {
  1758.     this create_other_door direction
  1759.     if direction == 1
  1760.         this n create_other_door 2
  1761.     if direction == 2
  1762.         this s create_other_door 1
  1763.     if direction == 3
  1764.         this e create_other_door 4
  1765.     if direction == 4
  1766.         this w create_other_door 3
  1767.     if direction == 9
  1768.         this up create_other_door 10
  1769.     if direction == 10
  1770.         this down create_other_door 9
  1771. }
  1772.  
  1773. method init
  1774. {
  1775.     object o
  1776.     object innerbox
  1777.     object box
  1778.     int i
  1779.  
  1780.     print
  1781.         "Escape from Planet Delta by Russell Wallace\n\n"
  1782.  
  1783.         "Originally written with The Quill on the Commodore 64 "
  1784.         "in the mid eighties and ported to OASYS in January 1991. This game "
  1785.         "is public domain and source and object code may be freely copied and "
  1786.         "used.\n\n"
  1787.  
  1788.         "The plot is as follows: You were on a starship flying to the planet "
  1789.         "Betelgeuse Delta, fourth planet of the Betelgeuse star system. On "
  1790.         "approaching the planet for landing, the ship developed engine "
  1791.         "trouble and appeared to be about to crash. Unfortunately there was "
  1792.         "not quite enough lifeboat space for everyone, so your shipmates beat "
  1793.         "you up, threw you into the control room, locked the door, grabbed "
  1794.         "the lifeboat, ejected and are probably on their way back to Earth by "
  1795.         "now. The ship crash landed but amazingly is still mostly intact and "
  1796.         "you survived the landing. However there is no chance of your being "
  1797.         "able to fly it out of here, so you will have to look for the "
  1798.         "Starfleet base on the planet and try to find some means of escape.\n\n"
  1799.  
  1800.         "Commands can be multiple words, but words like ALL, IT and AND are "
  1801.         "not supported. SAVE saves the game and LOAD reloads your position. "
  1802.         "VERBOSE, BRIEF and NORMAL give you different lengths of location "
  1803.         "descriptions.\n\n"
  1804.  
  1805.         "Good luck!\n\n"
  1806.  
  1807.     player = create player
  1808.  
  1809.             // Create all the normal objects
  1810.  
  1811.     lamp = create lamp
  1812.     card = create card
  1813.     torch = create torch
  1814.     herring = create herring
  1815.     safe = create safe
  1816.     detonator = create detonator
  1817.     plastic_key = create plastic_key
  1818.     metal_key = create metal_key
  1819.     ceramic_key = create ceramic_key
  1820.     suit = create suit
  1821.     explosive = create explosive
  1822.     mask = create mask
  1823.     whisky = create whisky
  1824.     disk = create disk
  1825.     drive = create drive
  1826.     book = create book
  1827.     computer = create computer
  1828.     socket = create socket
  1829.     ladder = create ladder
  1830.     scrap = create scrap
  1831.     paper = create paper
  1832.     pan = create pan
  1833.     shovel = create shovel
  1834.     bottle = create bottle
  1835.     rubble = create rubble
  1836.     desk = create desk
  1837.     tiger = create tiger
  1838.  
  1839.             // Create all the locations
  1840.  
  1841.     control_room = create room
  1842.     corridor1 = create room
  1843.     corridor2 = create room
  1844.     corridor3 = create room
  1845.     office1 = create room
  1846.     office2 = create room
  1847.     lift_top = create room
  1848.     corridor4 = create room
  1849.     bar = create room
  1850.     kitchen = create room
  1851.     cargo_hold = create room
  1852.     lift_centre = create room
  1853.     explosive_store = create room
  1854.     corridor5 = create room
  1855.     corridor6 = create room
  1856.     chemical_store = create room
  1857.     corridor7 = create room
  1858.     corridor8 = create room
  1859.     storage_compartment = create room
  1860.     corridor9 = create room
  1861.     locker = create room
  1862.     corridor10 = create room
  1863.     corridor11 = create room
  1864.     corridor12 = create room
  1865.     fridge = create room
  1866.     equipment_store = create room
  1867.     lift_bottom = create room
  1868.     airlock = create room
  1869.     crater = create room
  1870.     cave_entrance = create room
  1871.     cave1 = create room
  1872.     maze1 = create room
  1873.     maze2 = create room
  1874.     maze3 = create room
  1875.     maze4 = create room
  1876.     maze5 = create room
  1877.     maze6 = create room
  1878.     tunnel1 = create room
  1879.     tunnel2 = create room
  1880.     canyon_centre = create room
  1881.     canyon_south = create room
  1882.     cave2 = create room
  1883.     canyon_north = create room
  1884.     canyon_teleport = create room
  1885.     hangar_teleport = create room
  1886.     hangar = create room
  1887.     corridor19 = create room
  1888.     computer_room = create room
  1889.     airlock2 = create room
  1890.     corridor13 = create room
  1891.     corridor14 = create room
  1892.     corridor15 = create room
  1893.     corridor16 = create room
  1894.     corridor17 = create room
  1895.     corridor18 = create room
  1896.     control_room2 = create room
  1897.  
  1898.             // Assign exits from locations
  1899.  
  1900.     control_room e = corridor1
  1901.     corridor1 w = control_room
  1902.     corridor1 e = lift_top
  1903.     corridor1 ne = corridor2
  1904.     corridor2 n = office1
  1905.     corridor2 sw = corridor1
  1906.     corridor2 e = corridor3
  1907.     corridor3 w = corridor2
  1908.     corridor3 n = office2
  1909.     office1 s = corridor2
  1910.     office2 s = corridor3
  1911.     lift_top w = corridor1
  1912.     lift_top down = lift_centre
  1913.     corridor4 w = kitchen
  1914.     corridor4 e = lift_centre
  1915.     corridor4 se = bar
  1916.     corridor4 ne = cargo_hold
  1917.     bar nw = corridor4
  1918.     kitchen e = corridor4
  1919.     cargo_hold sw = corridor4
  1920.     lift_centre w = corridor4
  1921.     lift_centre up = lift_top
  1922.     lift_centre down = lift_bottom
  1923.     explosive_store e = corridor5
  1924.     corridor5 e = corridor6
  1925.     corridor5 w = explosive_store
  1926.     corridor6 w = corridor5
  1927.     corridor6 e = lift_bottom
  1928.     corridor6 ne = corridor7
  1929.     corridor6 n = chemical_store
  1930.     chemical_store s = corridor6
  1931.     corridor7 sw = corridor6
  1932.     corridor7 n = corridor10
  1933.     corridor7 se = corridor8
  1934.     corridor8 nw = corridor7
  1935.     corridor8 e = corridor9
  1936.     corridor8 n = storage_compartment
  1937.     storage_compartment s = corridor8
  1938.     corridor9 w = corridor8
  1939.     corridor9 s = airlock
  1940.     corridor9 e = locker
  1941.     locker w = corridor9
  1942.     corridor10 s = corridor7
  1943.     corridor11 s = corridor10
  1944.     corridor11 n = equipment_store
  1945.     corridor11 w = corridor12
  1946.     corridor12 e = corridor11
  1947.     corridor12 w = fridge
  1948.     fridge e = corridor12
  1949.     equipment_store s = corridor11
  1950.     lift_bottom w = corridor6
  1951.     lift_bottom up = lift_centre
  1952.     airlock n = corridor9
  1953.     airlock down = crater
  1954.     crater up = airlock
  1955.     crater e = cave_entrance
  1956.     cave_entrance w = crater
  1957.     cave_entrance se = cave1
  1958.     cave1 nw = cave_entrance
  1959.     cave1 e = maze1
  1960.     maze1 w = cave1
  1961.     maze1 s = maze2
  1962.     maze1 sw = maze1
  1963.     maze1 nw = maze1
  1964.     maze1 n = maze2
  1965.     maze1 ne = maze1
  1966.     maze1 e = maze1
  1967.     maze1 se = maze1
  1968.     maze2 se = maze3
  1969.     maze2 s = maze1
  1970.     maze2 sw = maze1
  1971.     maze2 w = maze2
  1972.     maze2 nw = maze2
  1973.     maze2 n = maze1
  1974.     maze2 ne = maze1
  1975.     maze2 e = maze2
  1976.     maze3 n = maze4
  1977.     maze3 ne = maze1
  1978.     maze3 e = maze2
  1979.     maze3 se = maze3
  1980.     maze3 s = maze2
  1981.     maze3 sw = maze2
  1982.     maze3 w = maze1
  1983.     maze3 nw = maze3
  1984.     maze4 ne = maze5
  1985.     maze4 e = maze4
  1986.     maze4 se = maze3
  1987.     maze4 s = maze4
  1988.     maze4 sw = maze2
  1989.     maze4 w = maze1
  1990.     maze4 nw = maze2
  1991.     maze4 n = maze3
  1992.     maze5 s = maze6
  1993.     maze5 sw = maze2
  1994.     maze5 w = maze3
  1995.     maze5 nw = maze2
  1996.     maze5 n = maze4
  1997.     maze5 ne = maze4
  1998.     maze5 e = maze1
  1999.     maze5 se = maze1
  2000.     maze6 e = tunnel1
  2001.     maze6 se = maze2
  2002.     maze6 s = maze5
  2003.     maze6 sw = maze4
  2004.     maze6 w = maze4
  2005.     maze6 nw = maze1
  2006.     maze6 n = maze2
  2007.     maze6 ne = maze3
  2008.     tunnel1 w = maze6
  2009.     tunnel2 w = tunnel1
  2010.     tunnel2 e = canyon_centre
  2011.     canyon_centre w = tunnel2
  2012.     canyon_centre n = canyon_north
  2013.     canyon_centre s = canyon_south
  2014.     canyon_south n = canyon_centre
  2015.     canyon_south se = cave2
  2016.     cave2 nw = canyon_south
  2017.     canyon_north s = canyon_centre
  2018.     canyon_north n = canyon_teleport
  2019.     canyon_teleport s = canyon_north
  2020.     hangar_teleport n = hangar
  2021.     hangar s = hangar_teleport
  2022.     hangar e = corridor19
  2023.     corridor19 w = hangar
  2024.     corridor19 e = computer_room
  2025.     computer_room w = corridor19
  2026.     airlock2 down = hangar
  2027.     airlock2 up = corridor14
  2028.     corridor13 e = corridor14
  2029.     corridor13 up = corridor16
  2030.     corridor14 w = corridor13
  2031.     corridor14 e = corridor15
  2032.     corridor14 down = airlock2
  2033.     corridor15 w = corridor14
  2034.     corridor15 up = corridor18
  2035.     corridor16 down = corridor13
  2036.     corridor16 e = corridor17
  2037.     corridor17 w = corridor16
  2038.     corridor17 e = corridor18
  2039.     corridor17 up = control_room2
  2040.     corridor18 w = corridor17
  2041.     corridor18 down = corridor15
  2042.     control_room2 down = corridor17
  2043.  
  2044.             // Location short descriptions
  2045.  
  2046.     control_room short_desc = "Control Room"
  2047.     corridor1 short_desc = "Corridor"
  2048.     corridor2 short_desc = "Corridor"
  2049.     corridor3 short_desc = "Corridor"
  2050.     office1 short_desc = "Office"
  2051.     office2 short_desc = "Office"
  2052.     lift_top short_desc = "Top of Lift"
  2053.     corridor4 short_desc = "Corridor"
  2054.     bar short_desc = "Bar"
  2055.     kitchen short_desc = "Kitchen"
  2056.     cargo_hold short_desc = "Cargo Hold"
  2057.     lift_centre short_desc = "Centre of Lift"
  2058.     explosive_store short_desc = "Store Room"
  2059.     corridor5 short_desc = "Corridor"
  2060.     corridor6 short_desc = "Corridor"
  2061.     chemical_store short_desc = "Store Room"
  2062.     corridor7 short_desc = "Corridor"
  2063.     corridor8 short_desc = "Corridor"
  2064.     storage_compartment short_desc = "Storage Compartment"
  2065.     corridor9 short_desc = "Corridor"
  2066.     locker short_desc = "Space Suit Locker"
  2067.     corridor10 short_desc = "Corridor"
  2068.     corridor11 short_desc = "Corridor"
  2069.     corridor12 short_desc = "Corridor"
  2070.     fridge short_desc = "Refridgeration Room"
  2071.     equipment_store short_desc = "Store Room"
  2072.     lift_bottom short_desc = "Bottom of Lift"
  2073.     airlock short_desc = "Airlock"
  2074.     crater short_desc = "Crater"
  2075.     cave_entrance short_desc = "Cave Entrance"
  2076.     cave1 short_desc = "Cave"
  2077.     maze1 short_desc = "Maze"
  2078.     maze2 short_desc = "Maze"
  2079.     maze3 short_desc = "Maze"
  2080.     maze4 short_desc = "Maze"
  2081.     maze5 short_desc = "Maze"
  2082.     maze6 short_desc = "Maze"
  2083.     tunnel1 short_desc = "Tunnel"
  2084.     tunnel2 short_desc = "Tunnel"
  2085.     canyon_centre short_desc = "Canyon Centre"
  2086.     canyon_south short_desc = "Canyon South"
  2087.     cave2 short_desc = "Cave"
  2088.     canyon_north short_desc = "Canyon North"
  2089.     canyon_teleport short_desc = "Teleport Cubicle"
  2090.     hangar_teleport short_desc = "Teleport Cubicle"
  2091.     hangar short_desc = "Hangar"
  2092.     corridor19 short_desc = "Corridor"
  2093.     computer_room short_desc = "Computer Room"
  2094.     airlock2 short_desc = "Airlock"
  2095.     corridor13 short_desc = "End of Corridor"
  2096.     corridor14 short_desc = "Corridor"
  2097.     corridor15 short_desc = "End of Corridor"
  2098.     corridor16 short_desc = "End of Corridor"
  2099.     corridor17 short_desc = "Corridor"
  2100.     corridor18 short_desc = "End of Corridor"
  2101.     control_room2 short_desc = "Control Room"
  2102.  
  2103.             // Location long descriptions
  2104.  
  2105.     control_room long_desc =
  2106.     "You are in the control room of the starship. To the west, the front "
  2107.     "window gives a spectacular view of the completely desolate, lifeless, "
  2108.     "airless and generally not very interesting surface of planet "
  2109.     "Betelgeuse Delta. To the east is the door leading to the rest of the "
  2110.     "ship. The control panel is blotched with large dead patches where "
  2111.     "the lights and dials have gone out."
  2112.  
  2113.     corridor1 long_desc =
  2114.     "This is a short corridor connecting the control room to the west with "
  2115.     "the gravity lift to the east. Another corridor leads north-east."
  2116.  
  2117.     corridor2 long_desc =
  2118.     "This is a corridor running around the top deck of the ship. To the "
  2119.     "north is a doorway and to the south is the gravity lift. The corridor "
  2120.     "extends east and southwest."
  2121.  
  2122.     corridor3 long_desc =
  2123.     "This is the east end of a short east-west corridor. To the north is "
  2124.     "a door."
  2125.  
  2126.     office1 long_desc =
  2127.     "This is a small undistinguished office. A doorway leads south into a "
  2128.     "corridor."
  2129.  
  2130.     office2 long_desc =
  2131.     "This is a large spacious office. On the wall is a picture of an "
  2132.     "exotic alien landscape."
  2133.  
  2134.     lift_top long_desc =
  2135.     "You are at the top of the gravity lift, an open shaft running "
  2136.     "vertically through all three decks of the ship and containing a "
  2137.     "field which neutralizes the ship's artificial gravity. Rungs run "
  2138.     "the length of the shaft by which people can pull themselves up and "
  2139.     "down. The shaft extends about six metres below you. A corridor "
  2140.     "leads west."
  2141.  
  2142.     corridor4 long_desc =
  2143.     "This is a short corridor connecting the kitchen to the west with "
  2144.     "the lift to the east. The bar is to the southeast and a doorway leads "
  2145.     "northeast."
  2146.  
  2147.     bar long_desc =
  2148.     "This is the most heavily frequented part of the ship. One wall is "
  2149.     "covered with racks, now sadly empty, for holding bottles of various "
  2150.     "kinds. A doorway leads northwest."
  2151.  
  2152.     kitchen long_desc =
  2153.     "You are in the ship's kitchen surrounded by devices for preparing "
  2154.     "food. A doorway leads east."
  2155.  
  2156.     cargo_hold long_desc =
  2157.     "You are standing on a catwalk overlooking the cargo hold which "
  2158.     "occupies much of the space in the middle of the ship. The hold is "
  2159.     "currently full of containers covered with cryptic markings, the "
  2160.     "nearest one close enough to touch but unfortunately for you "
  2161.     "sealed and designed to withstand anything short of a nuclear "
  2162.     "explosion. A doorway leads southwest."
  2163.  
  2164.     lift_centre long_desc =
  2165.     "This is the centre of the gravity lift. The shaft extends for about "
  2166.     "three metres up and down. A corridor leads west."
  2167.  
  2168.     explosive_store long_desc =
  2169.     "This room is used for storing explosives. A door leads east."
  2170.  
  2171.     corridor5 long_desc =
  2172.     "You are at the west end of a long corridor. A door to the west bears "
  2173.     "the sign \"DANGER - EXPLOSIVES\"."
  2174.  
  2175.     corridor6 long_desc =
  2176.     "You are in a corridor which continues to the west and northeast. "
  2177.     "The gravity lift is to the east. A door to the north bears the sign "
  2178.     "\"DANGER - HAZARDOUS CHEMICALS\"."
  2179.  
  2180.     chemical_store long_desc =
  2181.     "This room is used for storing chemical supplies. A door leads south."
  2182.  
  2183.     corridor7 long_desc =
  2184.     "This corridor leads around the lower deck of the ship. It continues "
  2185.     "southwest and southeast and another corridor leads north."
  2186.  
  2187.     corridor8 long_desc =
  2188.     "You are in a corridor which continues to the east and northwest. To "
  2189.     "the north is a door."
  2190.  
  2191.     storage_compartment long_desc =
  2192.     "You are in a small storage compartment. The only exit is south."
  2193.  
  2194.     corridor9 long_desc =
  2195.     "You are at the east end of an east-west corridor. To the south is the "
  2196.     "entrance to the airlock. To the east is a door with a damaged lock "
  2197.     "and a padlock fastened to it."
  2198.  
  2199.     locker long_desc =
  2200.     "You are in the ship's space suit storage locker. There is a door to "
  2201.     "the west."
  2202.  
  2203.     corridor10 long_desc =
  2204.     "This is a north-south corridor. To the north you can see the glow of "
  2205.     "the one-way neural barrier security system. You know that the field "
  2206.     "works by interfering with the nervous system of the target."
  2207.  
  2208.     corridor11 long_desc =
  2209.     "This is a north-south corridor. To the north is a doorway and another "
  2210.     "corridor leads west."
  2211.  
  2212.     corridor12 long_desc =
  2213.     "This is a short corridor connecting the refrigeration room to the "
  2214.     "west with another corridor to the east."
  2215.  
  2216.     fridge long_desc =
  2217.     "This is the refrigeration room where the ship's food supply was "
  2218.     "stored at 20 degrees below freezing. Fortunately for your comfort "
  2219.     "but unfortunately for your prospects of having an intact food supply "
  2220.     "for much longer, the temperature control appears to have been "
  2221.     "banjaxed when you blew up the door. Exit is east through the remains "
  2222.     "of said door."
  2223.  
  2224.     equipment_store long_desc =
  2225.     "This is a room used for storing various kinds of equipment. A "
  2226.     "doorway leads south."
  2227.  
  2228.     lift_bottom long_desc =
  2229.     "You are at the bottom of the gravity lift. The shaft extends up for "
  2230.     "about six metres. A corridor leads west."
  2231.  
  2232.     airlock long_desc =
  2233.     "This is the ship's airlock. The inner door is to the north and the "
  2234.     "outer door leads down to the surface. There is a keypad on the wall "
  2235.     "for typing in the access code to open the outer door."
  2236.  
  2237.     crater long_desc =
  2238.     "You are standing on the planet's surface in the crater in which the "
  2239.     "starship crash landed. The ship towers above you and can be entered "
  2240.     "by going up to the airlock door. The crater is ringed with jagged "
  2241.     "mountains but to the east you can see the entrance to a cave. There "
  2242.     "is a keypad beside the airlock door for typing the access code to "
  2243.     "open the door."
  2244.  
  2245.     cave_entrance long_desc =
  2246.     "You are in the entrance to an underground cave. To the west is an "
  2247.     "opening leading out into a large crater. A passage to the southeast "
  2248.     "leads deeper into the cave."
  2249.  
  2250.     cave1 long_desc =
  2251.     "You are in an underground cave. Passages lead northwest and east."
  2252.  
  2253.     maze1 long_desc =
  2254.     "You are in a maze of twisting underground passages."
  2255.  
  2256.     maze2 long_desc =
  2257.     "You are in a maze of twisting underground passages."
  2258.  
  2259.     maze3 long_desc =
  2260.     "You are in a maze of twisting underground passages."
  2261.  
  2262.     maze4 long_desc =
  2263.     "You are in a maze of twisting underground passages."
  2264.  
  2265.     maze5 long_desc =
  2266.     "You are in a maze of twisting underground passages."
  2267.  
  2268.     maze6 long_desc =
  2269.     "You are in a maze of twisting underground passages."
  2270.  
  2271.     tunnel1 long_desc =
  2272.     "You are in an underground tunnel which leads east-west."
  2273.  
  2274.     tunnel2 long_desc =
  2275.     "You are in an underground tunnel. You can see the gleam of starlight "
  2276.     "to the east. The tunnel continues to the west."
  2277.  
  2278.     canyon_centre long_desc =
  2279.     "You are in a deep canyon which runs north and south. You can see a "
  2280.     "cave entrance in the west wall of the canyon."
  2281.  
  2282.     canyon_south long_desc =
  2283.     "You are at the south end of the canyon. You can see a cave entrance "
  2284.     "to the southeast."
  2285.  
  2286.     cave2 long_desc =
  2287.     "You are in a small cramped cave. The cave exit is northwest."
  2288.  
  2289.     canyon_north long_desc =
  2290.     "You are at the north end of the canyon. A small metal structure "
  2291.     "stands to the north and can be entered by a door."
  2292.  
  2293.     canyon_teleport long_desc =
  2294.     "You are in a small teleport cubicle. Through a window set into the "
  2295.     "door you can see out into a canyon."
  2296.  
  2297.     hangar_teleport long_desc =
  2298.     "You are in a small teleport cubicle which opens into a spacecraft "
  2299.     "hangar to the north."
  2300.  
  2301.     hangar long_desc =
  2302.     "You are in a large spacecraft hangar, the type with a roof which can "
  2303.     "open to let ships land and take off and close so the place can be "
  2304.     "pressurized. There is a small spaceship standing in the middle of "
  2305.     "the chamber, the entrance to the airlock being a few metres above "
  2306.     "your head. A small cubicle is set into the south wall and a "
  2307.     "corridor leads east."
  2308.  
  2309.     corridor19 long_desc =
  2310.     "You are in a short east-west corridor."
  2311.  
  2312.     computer_room long_desc =
  2313.     "You are in a large room with gleaming metal walls, the place from "
  2314.     "which the operation of the base is supervised. The walls are lined "
  2315.     "with instruments of various kinds that you haven't a clue how to "
  2316.     "read. A corridor leads west."
  2317.  
  2318.     airlock2 long_desc =
  2319.     "You are in the airlock of a small spaceship. You can go down through "
  2320.     "the outer door or up through the inner door."
  2321.  
  2322.     corridor13 long_desc =
  2323.     "You are at the west end of a corridor. A ladder leads up."
  2324.  
  2325.     corridor14 long_desc =
  2326.     "You are in the middle of an east-west corridor. A hatch leads down "
  2327.     "into the airlock."
  2328.  
  2329.     corridor15 long_desc =
  2330.     "You are at the east end of a corridor. A ladder leads up."
  2331.  
  2332.     corridor16 long_desc =
  2333.     "You are at the west end of a corridor. A ladder leads down."
  2334.  
  2335.     corridor17 long_desc =
  2336.     "You are in the middle of an east-west corridor. A ladder leads up "
  2337.     "to a door."
  2338.  
  2339.     corridor18 long_desc =
  2340.     "You are at the east end of a corridor. A ladder leads down."
  2341.  
  2342.     control_room2 long_desc =
  2343.     "This is the control room of the spaceship. You can see the interior "
  2344.     "of the hangar through the front windows. A door leads down. A "
  2345.     "label beside the control panel says, THE AUTHORIZATION CODE TO "
  2346.     "ACTIVATE THE AUTOPILOT IS THE TENTH, ELEVENTH, TWELFTH AND "
  2347.     "THIRTEENTH DIGITS OF PI. TYPE IN THE NUMBER ON THE KEYPAD."
  2348.  
  2349.             // Special code to create some boxes nested inside each other
  2350.  
  2351.     i = 10
  2352.     box = create box
  2353.     box short_desc = "a box"
  2354.     box word_desc = "box"
  2355.     box moved = 1
  2356.     box weight = 100
  2357.     innerbox = box
  2358.     do
  2359.     {
  2360.         o = create box
  2361.         box in = o
  2362.         box = o
  2363.         box short_desc = "a box"
  2364.         box word_desc = "box"
  2365.         box moved = 1
  2366.         box weight = 100
  2367.         i = i - 1
  2368.     }
  2369.     while i
  2370.  
  2371.             // Position the outermost box in the first location
  2372.  
  2373.     box in = control_room
  2374.     box moved = 0
  2375.     box long_desc = "There is a large box sitting on the floor."
  2376.  
  2377.             // Only two objects start the game open
  2378.  
  2379.     drive is_open = 1
  2380.     bottle is_open = 1
  2381.  
  2382.             // Create the buttons for the teleport devices
  2383.  
  2384.     o = create button
  2385.     o weight = 9999
  2386.     o long_desc = "There is a button set into the wall."
  2387.     o word_desc = "button"
  2388.     o examine_desc = "You could try pressing it."
  2389.     o in = canyon_teleport
  2390.  
  2391.     o = create button
  2392.     o weight = 9999
  2393.     o long_desc = "There is a button set into the wall."
  2394.     o word_desc = "button"
  2395.     o examine_desc = "You could try pressing it."
  2396.     o in = hangar_teleport
  2397.  
  2398.             // Position all objects initially
  2399.  
  2400.     player in = control_room
  2401.  
  2402.     lamp in = fridge
  2403.     card in = innerbox
  2404.     torch in = innerbox
  2405.     herring in = kitchen
  2406.     safe in = office1
  2407.     detonator in = chemical_store
  2408.     ceramic_key in = locker
  2409.     suit in = locker
  2410.     explosive in = explosive_store
  2411.     mask in = explosive_store
  2412.     whisky in = bottle
  2413.     disk in = safe
  2414.     drive in = equipment_store
  2415.     book in = safe
  2416.     computer in = storage_compartment
  2417.     socket in = computer_room
  2418.     ladder in = equipment_store
  2419.     scrap in = cave2
  2420.     paper in = storage_compartment
  2421.     pan in = kitchen
  2422.     shovel in = equipment_store
  2423.     bottle in = bar
  2424.     rubble in = tunnel1
  2425.     desk in = office2
  2426.     tiger in = corridor19
  2427.  
  2428.             // Object short descriptions
  2429.  
  2430.     lamp short_desc = "an atomic lamp"
  2431.     card short_desc = "an American Express card"
  2432.     torch short_desc = "an oxy-acetylene torch"
  2433.     herring short_desc = "a red herring"
  2434.     detonator short_desc = "a detonator"
  2435.     plastic_key short_desc = "a plastic key"
  2436.     metal_key short_desc = "a metal key"
  2437.     ceramic_key short_desc = "a ceramic key"
  2438.     suit short_desc = "a space suit"
  2439.     explosive short_desc = "some plastic explosive"
  2440.     mask short_desc = "a gas mask"
  2441.     whisky short_desc = "some Scotch whisky"
  2442.     disk short_desc = "a floppy disk"
  2443.     drive short_desc = "a disk drive"
  2444.     book short_desc = "a book"
  2445.     computer short_desc = "a computer"
  2446.     ladder short_desc = "a ladder"
  2447.     scrap short_desc = "a piece of scrap metal"
  2448.     paper short_desc = "a sheet of paper"
  2449.     pan short_desc = "a saucepan"
  2450.     shovel short_desc = "a shovel"
  2451.     bottle short_desc = "a whisky bottle"
  2452.  
  2453.             // Object one-word names
  2454.  
  2455.     lamp word_desc = "lamp"
  2456.     card word_desc = "card"
  2457.     torch word_desc = "torch"
  2458.     herring word_desc = "herring"
  2459.     detonator word_desc = "detonator"
  2460.     plastic_key word_desc = "plastic key"
  2461.     metal_key word_desc = "metal key"
  2462.     ceramic_key word_desc = "ceramic key"
  2463.     suit word_desc = "space suit"
  2464.     explosive word_desc = "explosive"
  2465.     mask word_desc = "gas mask"
  2466.     whisky word_desc = "whisky"
  2467.     disk word_desc = "disk"
  2468.     drive word_desc = "disk drive"
  2469.     book word_desc = "book"
  2470.     computer word_desc = "computer"
  2471.     ladder word_desc = "ladder"
  2472.     scrap word_desc = "scrap metal"
  2473.     paper word_desc = "sheet of paper"
  2474.     pan word_desc = "saucepan"
  2475.     shovel word_desc = "shovel"
  2476.     bottle word_desc = "bottle"
  2477.  
  2478.             // Object long descriptions. Note that some objects will never need
  2479.             // long descriptions as they will be moved when the player sees
  2480.             // them for the first time.
  2481.  
  2482.     lamp long_desc = "An atomic lamp is sitting on a shelf."
  2483.     card moved = 1
  2484.     torch moved = 1
  2485.     herring long_desc = "There is a red herring on the counter."
  2486.     safe long_desc = "There is a large steel safe in the corner."
  2487.     detonator long_desc = "An object which you recognize as a detonator "
  2488.         "is sitting on a shelf."
  2489.     plastic_key moved = 1
  2490.     metal_key moved = 1
  2491.     ceramic_key long_desc = "There is a small ceramic key on a shelf."
  2492.     suit long_desc = "A space suit is hanging on a rack."
  2493.     explosive long_desc = "There is some plastic explosive on a shelf."
  2494.     mask long_desc = "A gas mask is hanging on a hook."
  2495.     whisky moved = 1
  2496.     disk moved = 1
  2497.     drive long_desc = "There is a disk drive here."
  2498.     book moved = 1
  2499.     computer long_desc = "There is a computer on a shelf."
  2500.     socket long_desc = "On one wall is a data communications socket."
  2501.     ladder long_desc = "There is a ladder leaning against the wall."
  2502.     scrap long_desc = "There is a piece of scrap metal lying in the "
  2503.         "corner."
  2504.     paper long_desc = "There is a sheet of paper lying on the floor."
  2505.     pan long_desc = "There is a saucepan on a counter."
  2506.     shovel long_desc = "A shovel is leaning against the wall."
  2507.     bottle long_desc = "Amazingly there is still a whisky bottle sitting "
  2508.         "on the counter."
  2509.     rubble long_desc = "A pile of rubble is blocking the passage to the "
  2510.         "east."
  2511.     desk long_desc = "There is a large, expensive-looking desk in the "
  2512.         "middle of the room."
  2513.     tiger long_desc = "A large tiger steps out in front of you and smiles. "
  2514.         "It doesn't actually look like it's baring its teeth in a "
  2515.         "threatening manner. It looks like it's smiling in "
  2516.         "happiness at the prospect of some fresh meat for the "
  2517.         "first time in ages. Looks like someone was a little "
  2518.         "over-enthusiastic in arranging to guard the premises while "
  2519.         "everyone was away."
  2520.  
  2521.             // Messages for examining objects
  2522.  
  2523.     lamp examine_desc = "This is a latest-model lamp powered by a built-in "
  2524.         "plutonium cell."
  2525.     card examine_desc = "This is an American Express card accepted nowhere "
  2526.         "in the entire known galaxy. For an explanation of its usefulness "
  2527.         "see \"So Long and Thanks For All the Fish\" by Douglas Adams."
  2528.     torch examine_desc = "This is an oxy-acetylene cutting torch with an "
  2529.         "integral fuel cell, capable of cutting through many metals."
  2530.     herring examine_desc = "It's just a red herring."
  2531.     safe examine_desc = "This huge massive safe must weigh at least half a "
  2532.         "ton. There is a keyhole in the front."
  2533.     detonator examine_desc = "This device can create the shock wave required "
  2534.         "to detonate modern plastic explosives."
  2535.     plastic_key examine_desc = "This is a key made from plastic. You open "
  2536.         "things with it."
  2537.     metal_key examine_desc = "This is a key made from metal. You open "
  2538.         "things with it."
  2539.     ceramic_key examine_desc = "This is a key made from ceramics. You open "
  2540.         "things with it."
  2541.     suit examine_desc = "This suit is designed to protect its wearer "
  2542.         "from the vacuum of space."
  2543.     explosive examine_desc = "This is a charge of plastic explosive of the "
  2544.         "type which can only be set off by a sharp shock wave."
  2545.     mask examine_desc = "This is a standard activated carbon filter gas mask "
  2546.         "which absorbs toxic substances from the air."
  2547.     whisky examine_desc = "The whisky is finest Scotch of a brand with which "
  2548.         "you are extremely familiar."
  2549.     disk examine_desc = "It's a standard 500-gigabyte 4-cm floppy disk."
  2550.     drive examine_desc = "It's a standard 500-gigabyte 4-cm floppy disk drive."
  2551.     book examine_desc = "It's a copy of Oolon Colluphid's philosophical "
  2552.         "blockbuster \"Who is this God Person Anyway?\"."
  2553.     computer examine_desc = "It's a small portable computer with 256 gigabytes "
  2554.         "of memory and an 11-gigaflops optical processor array. It also has "
  2555.         "a built-in screen and "
  2556.         "a cable for connection to a data communications socket. To use, "
  2557.         "connect it to a disk drive, put a boot disk in the drive and turn it "
  2558.         "on. The software on the disk will run automatically."
  2559.     socket examine_desc = "It's a standard 30-gigabaud optical data "
  2560.         "communications socket."
  2561.     ladder examine_desc = "It's a ladder. You climb things with it. Use it by "
  2562.         "putting it down in the appropriate place and typing GO UP."
  2563.     scrap examine_desc = "It's just some useless scrap metal which is why it "
  2564.         "was left lying in a cave in the first place."
  2565.     paper examine_desc = "It's part of a printout of a computer program. "
  2566.         "The number 7648 is scribbled on the back."
  2567.     pan examine_desc = "It's a saucepan. People cook things in it. "
  2568.         "Alternatively you could for example bash someone over the head with "
  2569.         "it if there was anyone around at the moment which there isn't but "
  2570.         "basically people use it for cooking."
  2571.     shovel examine_desc = "The shovel on closer examination actually turns "
  2572.         "out to be a portable interstellar spaceship in disguise. Ah no, "
  2573.         "only joking, it's just a shovel after all. Type DIG to use it."
  2574.     bottle examine_desc = "It's a Scotch whiskey bottle."
  2575.     rubble examine_desc = "It's a large mass of rubble collapsed from the "
  2576.         "ceiling, completely blocking the tunnel."
  2577.     desk examine_desc = "It's a large, imposing, uncluttered and expensive-"
  2578.         "looking desk."
  2579.     tiger examine_desc = "It's a large furry creature with four legs, a tail, "
  2580.         "black and orange stripes and lots of large sharp teeth."
  2581.  
  2582.             // Object weights
  2583.  
  2584.     lamp weight = 150
  2585.     card weight = 5
  2586.     torch weight = 160
  2587.     herring weight = 120
  2588.     safe weight = 9999
  2589.     detonator weight = 75
  2590.     plastic_key weight = 5
  2591.     metal_key weight = 7
  2592.     ceramic_key weight = 6
  2593.     suit weight = 400
  2594.     explosive weight = 80
  2595.     mask weight = 85
  2596.     whisky weight = 40
  2597.     disk weight = 7
  2598.     drive weight = 65
  2599.     book weight = 65
  2600.     computer weight = 300
  2601.     socket weight = 9999
  2602.     ladder weight = 300
  2603.     scrap weight = 300
  2604.     paper weight = 2
  2605.     pan weight = 110
  2606.     shovel weight = 200
  2607.     bottle weight = 60
  2608.     rubble weight = 9999
  2609.     desk weight = 9999
  2610.     tiger weight = 9999
  2611.  
  2612.             // Create doors between locations (all initially closed)
  2613.  
  2614.     control_room create_door 3
  2615.     corridor3 create_door 1
  2616.     corridor12 create_door 4
  2617.     corridor9 create_door 3
  2618.     corridor5 create_door 4
  2619.     corridor6 create_door 1
  2620.     storage_compartment create_door 2
  2621.     airlock create_door 10
  2622.     canyon_north create_door 1
  2623.     corridor17 create_door 9
  2624.  
  2625.             // Which locations are dark
  2626.  
  2627.     cave1 is_dark = 1
  2628.     maze1 is_dark = 1
  2629.     maze2 is_dark = 1
  2630.     maze3 is_dark = 1
  2631.     maze4 is_dark = 1
  2632.     maze5 is_dark = 1
  2633.     maze6 is_dark = 1
  2634.     tunnel1 is_dark = 1
  2635.  
  2636.             // Which locations are in vacuum
  2637.  
  2638.     crater is_vacuum = 1
  2639.     cave_entrance is_vacuum = 1
  2640.     cave1 is_vacuum = 1
  2641.     maze1 is_vacuum = 1
  2642.     maze2 is_vacuum = 1
  2643.     maze3 is_vacuum = 1
  2644.     maze4 is_vacuum = 1
  2645.     maze5 is_vacuum = 1
  2646.     maze6 is_vacuum = 1
  2647.     tunnel1 is_vacuum = 1
  2648.     tunnel2 is_vacuum = 1
  2649.     canyon_north is_vacuum = 1
  2650.     canyon_centre is_vacuum = 1
  2651.     canyon_south is_vacuum = 1
  2652.     cave2 is_vacuum = 1
  2653.     canyon_teleport is_vacuum = 1
  2654.  
  2655.             // Start off by describing initial location
  2656.  
  2657.     player describe_location 0
  2658. }
  2659.